# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_gemname=forwardable-extended
pkgname=ruby-forwardable-extended
pkgver=2.6.0
pkgrel=6
pkgdesc='Extends forwardable with delegation to hashes and instance variables'
url='https://github.com/envygeeks/forwardable-extended'
arch=('any')
license=('MIT')
depends=('ruby')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/envygeeks/forwardable-extended/archive/v${pkgver}.tar.gz)
sha256sums=('d19fc7802c7e2261530e50da15b612e3bdd4f77b50c310ab2733b0affe5e2a22')
sha512sums=('23a682e06ee823b076d6b9925a1ef4ada4f1fc7fa63b02d1b9122485204b62f55c191866170b63b34891934c762ac903df46bf5a2b17055d7504ee7a70627a8b')

prepare() {
  cd ${_gemname}-${pkgver}
  mv Gem.gemspec ${_gemname}.gemspec
  sed -r 's|~>|>=|g' -i ${_gemname}.gemspec # don't give a fuck about rubys bla bla
}

build() {
  cd ${_gemname}-${pkgver}
  gem build ${_gemname}.gemspec
}

package() {
  cd ${_gemname}-${pkgver}
  local _gemdir="$(gem env gemdir)"
  gem install --ignore-dependencies --no-user-install -i "${pkgdir}${_gemdir}" -n "${pkgdir}/usr/bin" ${_gemname}-${pkgver}.gem
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  rm "${pkgdir}/${_gemdir}/cache/${_gemname}-${pkgver}.gem"
}

# vim: ts=2 sw=2 et:
